package com.da.javatest.enums;

import com.da.javatest.util.ApplicationContextProvider;

/**
 * @author chenlida
 * @date 2019/5/23 16:00
 * @description
 */
public enum CheckType {
    YES("yes", "是"),
    NO("no", "否");

    private String value;
    private String desc;

    CheckType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static boolean check(String value){
        if(YES.getValue().equals(value)){
            return true;
        }else if(NO.getValue().equals(value)){
            HelloTest bean = new ApplicationContextProvider().getApplicationContext().getBean(HelloTest.class);
            System.out.println(bean.getHello());
        }
        return false;
    }
}
